zcf-simde-crc32c
authorDebian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
Fri, 17 Oct 2025 14:12:47 +0000 (10:12 -0400)
committerAaron M. Ucko <ucko@debian.org>
Fri, 17 Oct 2025 14:12:47 +0000 (10:12 -0400)
Gbp-Pq: Name zcf-simde-crc32c

c++/src/util/compress/zlib_cloudflare/Makefile.zlib_cf.lib.unix
c++/src/util/compress/zlib_cloudflare/deflate.c

index 0157443c8d5f2eacdc883653ecaa4eced7e4b3bf..6b79ca0f5d5772a4437772c30fbf94464fff81db 100644 (file)
@@ -1,6 +1,6 @@
 # $Id: Makefile.zlib_cf.lib.unix 677587 2024-01-18 20:07:53Z ivanov $
 
-ifneq "" "$(findstring --arm,$(signature))$(findstring --aarch64,$(signature))"
+ifneq "" "$(findstring --arm64,$(signature))$(findstring --aarch64,$(signature))"
   crc32.o:   CFLAGS += -march=armv8-a+crc
   deflate.o: CFLAGS += -march=armv8-a+crc
 endif
index cb495d3b8fcab39a18501851d47fd172d6357d97..9b6fa1d97c94bc4a9cd2a6fd19e8f10c6b279e7b 100644 (file)
@@ -129,27 +129,11 @@ static const config configuration_table[10] = {
 /* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */
 #define RANK(f) (((f) * 2) - ((f) > 4 ? 9 : 0))
 
-#ifdef __aarch64__
-
-#include <arm_neon.h>
-#include <arm_acle.h>
-static uint32_t hash_func(deflate_state *s, void* str) {
-    return __crc32cw(0, *(uint32_t*)str) & s->hash_mask;
-}
-
-#elif defined __x86_64__ || defined _M_AMD64
-
-#include <immintrin.h>
+#include <simde/x86/sse4.2.h>
 static uint32_t hash_func(deflate_state *s, void* str) {
-    return _mm_crc32_u32(0, *(uint32_t*)str) & s->hash_mask;
+    return simde_mm_crc32_u32(0, *(uint32_t*)str) & s->hash_mask;
 }
 
-#else
-
-#error "Only 64-bit Intel and ARM architectures are supported"
-
-#endif
-
 /* ===========================================================================
  * Insert string str in the dictionary and return the previous head
  * of the hash chain (the most recent string with same hash key).